package com.fengdi.book.easy.String;

public class ReverseString {
    public void reverseString(char[] s) {
        if(s.length == 0 || s.length == 1) return;

        int left = 0, right = s.length - 1;
        while(left <= right) {
            char exchange = s[left];
            s[left] = s[right];
            s[right] = exchange;
            left++;
            right--;
        }
    }
}
